﻿@model LynxWiki.ViewModels.WikiTopicListingViewData

    <tr>
        <td class="TableCell"><a href="@Url.RouteUrl("PageDisplay", new { action = "Page", controller = "WikiTopic", pagePath = @Model.WikiDir + "/" + @Model.TopicName  })">
        @Model.TopicName</a></td>
        <td class="TableCell">@Model.WikiDir</td>
        <td class="TableCell">@Model.CreatedOn.ToString("yyyy-MM-dd HH:mm:ss")</td>
        @if (User.IsInRole("WikiAdmin")) {
            <td class="TableCell">
            @if (Model.TopicLocked) {
                <a href="@Url.RouteUrl("Default", new { action = "WikiTopicLockAction", controller = "WikiDirectory", topicName = Model.TopicName + "__current.xml", wikiDir = Model.WikiDir, lockAction = "unlock" })">
                Unlock</a>
            }
            else {
                <a href="@Url.RouteUrl("Default", new { action = "WikiTopicLockAction", controller = "WikiDirectory", topicName = Model.TopicName + "__current.xml", wikiDir = Model.WikiDir, lockAction = "lock" })">
                Lock</a>
            }
            <a href="@Url.RouteUrl("Default", new { action = "Delete", controller = "WikiTopic", topicName = Model.TopicName, wikiDir = Model.WikiDir })">
            Delete @Model.TopicName</a></td>
        }
    </tr>